package com.medicine.hbp.ui;

import org.kymjs.kjframe.ui.BindView;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

import com.medicine.hbp.base.BaseActivity;
import com.medicine.hbp.R;
/**
 * 帮助和关于界面
 * @author butterfly
 *
 */
public class HelpAndMessageActivity extends BaseActivity{
	@BindView(id=R.id.layout_help)public LinearLayout layout_help;
	@BindView(id=R.id.scrollView1)public ScrollView txt_msg;
	String name;
	int type;
	@Override
	public void setRootView() {
		super.setRootView();
		setContentView(R.layout.activity_helpandmessage);
	}
	@Override
	public void initWidget() {
		super.initWidget();
		type=getIntent().getIntExtra("type",-1);
		if(type==1){
			layout_help.setVisibility(View.GONE);
			txt_msg.setVisibility(View.VISIBLE);
		}else if(type==2){
			layout_help.setVisibility(View.VISIBLE);
			txt_msg.setVisibility(View.GONE);
		}
		name=getIntent().getStringExtra("name");
		initTop();
	}
	@Override
	public void widgetClick(View v) {
		super.widgetClick(v);
	}
	private void initTop() {
		TopView topview = (TopView) findViewById(R.id.topview);
		topview.setTitle(name);
		topview.setLeftVisibility(View.GONE);
		topview.setLeftVisibilityExit(View.VISIBLE);
		topview.setRightVisibility(View.INVISIBLE);
		topview.setLeftOnClickExit(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				finish();
			}
		});
	}
}
